home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / hdebug.zip / HEAP.HDR < prev    next >
Text File  |  1991-10-20  |  1KB  |  39 lines

  1.  
  2. Unit Heap;
  3.  
  4. {----------------------------------------------------------------------------}
  5.  
  6. interface
  7.  
  8.   uses
  9.     DOS,         {  For SetIntVec and GetIntVec  }
  10.     MapInfo;     {  To get statement addresses   }
  11.  
  12.   type
  13.     Handler = Procedure(Size : Word; BlockAddr,CallAddr : Pointer);
  14.  
  15.           {  Here's a way to assign procedures through pointer variables.
  16.              This eliminates any circular references to other units.         }
  17.  
  18.   var
  19.     Allocation_Handler_,
  20.     Deallocation_Handler_ : Handler;
  21.     Allocation_Handler    : Pointer absolute Allocation_Handler_;
  22.     Deallocation_Handler  : Pointer absolute Deallocation_Handler_;
  23.  
  24.     Allocation_Handler_Active,
  25.     Deallocation_Handler_Active,
  26.     FatalHeapError : Boolean;
  27.     InterceptFatalHeapErrors : Boolean;
  28.  
  29.   const
  30.     GetMemInt    = $F0;         {  User-selectable interrupt vectors for     }
  31.     FreeMemInt   = $F1;         {  intercepting the heap functions.          }
  32.     RestartInt   = $F2;         {  Restart after stopping the program.       }
  33.  
  34.   Procedure HeapOn;             {  Begin intercepting the heap functions.    }
  35.   Procedure HeapOff;            {  Quit intercepting the heap functions.     }
  36.  
  37.   Procedure Enter_Debugger(CallAddr : Pointer);
  38.  
  39.